package com.fuqi.android.zhongcai.base.view.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Lenovo on 2016/9/27.
 */
public class MyPagerAdapter extends FragmentPagerAdapter {


    private List<String> mTitles = new ArrayList<>();
    private List<Fragment> mFragments = new ArrayList<>();


    public MyPagerAdapter(FragmentManager fm,List<String> mTitles,List<Fragment> mFragments) {
        super(fm);
        this.mTitles = mTitles;
        this.mFragments = mFragments;

    }

    @Override
    public int getCount() {
        return mFragments.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return mTitles.get(position);
    }

    @Override
    public Fragment getItem(int position) {
        return mFragments.get(position);
    }
}
